#ifndef SHADOW_VOLUMN_SAMPLE_H
#define SHADOW_VOLUMN_SAMPLE_H
#include "SampleBase.h"
#include "glslprogram.h"
#include "plane.h"
#include "objmesh.h"
#include <glm/glm.hpp>
#include "Quad.h"
namespace ShaderLab {
	class ShadowVolumnSample : public SampleBase {
	public:
		ShadowVolumnSample();
		~ShadowVolumnSample();

		void Init();
		void Update(float time);
		void Render();
		void Imgui();
		void ShutDown();
	private:
		void UpdateMatrices(GLSLProgram &);
		void CreateShader();
		void FBO();
		void DrawScene(GLSLProgram &, bool);
		void Pass1();
		void Pass2();
		void Pass3();
	private:
		GLSLProgram volumeProg, renderProg, compProg;
		GLuint colorDepthFBO,spotTex, brickTex;
		std::unique_ptr<Plane> plane;
		std::unique_ptr<Quad> screenQuad;
		std::unique_ptr<ObjMesh> mesh;
		glm::vec4 lightPos;
		glm::mat4 model, view, projection;
	};
}
#endif // !TEMPLATE_SAMPLE_H
